Skip to content

feat(base): HIP-0110 ZAP server for forward + reverse push#7

Merged
hanzo-dev merged 3 commits into
mainfrom
feat/hip-0110-gateway-edge-process
May 30, 2026
Merged

feat(base): HIP-0110 ZAP server for forward + reverse push#7
hanzo-dev merged 3 commits into
mainfrom
feat/hip-0110-gateway-edge-process

Conversation

@hanzo-dev
Copy link
Copy Markdown
Member

Summary

  • Adds internal/zap/server.go — the HIP-0110 surface on top of base's existing plugins/zap socket.
  • Two handlers registered on upper-half message IDs that don't collide with the legacy plugins/zap IDs:
    • MsgTypeForward (0x1010) — decodes the gateway→base envelope and delegates to a pluggable Dispatcher.
    • MsgTypeSubscribe (0x1030) — records (ConnID, collection) → gateway peer ID for reverse-push routing.
  • Server.BroadcastRecord produces MsgTypePush envelopes when a record changes — pre-encoded SSE / WS frame, no JSON re-marshaling.
  • Reuses base's realtime subscription pattern; introduces no new pubsub.

Test plan

  • go build ./internal/zap/...
  • Unit test for Forward decode + dispatcher call
  • Integration: gateway dials base ZAP socket, sends Subscribe, base broadcasts Push back, gateway delivers to in-memory PushSink

@hanzo-dev hanzo-dev force-pushed the feat/hip-0110-gateway-edge-process branch from a06704f to d644b8e Compare May 29, 2026 19:57
hanzo-dev added 3 commits May 29, 2026 22:00
Aligns base internal/zap/server.go with github.com/hanzoai/gateway/zap_wire.go.
Constants were 0x1010/0x1020/0x1030; zap.FinishWithFlags shifts type<<8 into
the upper byte of a uint16, so types > 0xFF overflow. Repinned to 0x80/0x81/0x82
to match the gateway side.
@hanzo-dev hanzo-dev force-pushed the feat/hip-0110-gateway-edge-process branch from d644b8e to 52c2c69 Compare May 30, 2026 05:00
@hanzo-dev hanzo-dev merged commit 356608c into main May 30, 2026
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant